<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改密码</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link rel="stylesheet" href="admin/css/common.css" type="text/css" />
	<link rel="stylesheet" href="admin/css/provider.css" type="text/css" />
	<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript">
		function changepwd(){
			if($('#oldPassword').val() == ""){
				$('#oldTip').text("*请输入旧密码");
				$('#pwdTip').text("");
				$('#pwdChkTip').text("");
				$('#oldPassword').focus();
				return false;
			}else if($('#password').val() =="" ){
				$('#oldTip').text("");
				$('#pwdTip').text("*请输入新密码");
				$('#pwdChkTip').text("");
				$('#password').focus();
				return false;
			}else if($('#password').val() != $('#passwordChk').val()){
				$('#oldTip').text("");
				$('#pwdTip').text("");
				$('#pwdChkTip').text("*两次新密码不相同");
				$('#passwordChk').focus();
				return false;
			}else{
				var params = {
						oldPassword : $('#oldPassword').val(),
						password : $('#password').val()
					};
				jQuery.post("changeProviderPwd.action", params, changeAjax, "json");
			}
		}

		function changeAjax(data){
			if(data.chagePwdFlag == true){
				alert("密码修改成功!");
				window.location.reload();
			}else{
				alert("你输入的旧密码错误!");
			}
		}
	</script>
	
	<style type="text/css">
		a{
			padding:5px 10px 5px 0px;
			height: 30px;
			line-height: 30px;
		}
	</style>
  </head>
  
  <body>
  	<div id="provider_zone">
  	<form method="post">
	  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
	   <tr>
	      <td class="left_title_2" width="200px;">旧密码</td>
	      <td>
			<input type="password" id="oldPassword" name="oldPassword" />
			<span class="tip" id="oldTip"></span>
	      </td>
	    </tr>
	    <tr>
	      <td class="left_title_1">新密码</td>
	      <td>
	      	<input type="password" id="password" name="password" />
	      	<span class="tip" id="pwdTip"></span>
	      </td>
	    </tr>
	    <tr>
	      <td class="left_title_2">新密码确认</td>
	      <td>
	      	<input type="password" id="passwordChk" name="passwordChk" />
	      	<span class="tip" id="pwdChkTip"></span>
	      </td>
	    </tr>
	    <tr>
	      <td class="left_title_1" colspan="2">
	      	<input type="button" value="修改" class="input-submit"  onclick="return changepwd();">
	      </td>
	    </tr>
	  </table>
	  </form>
	</div>
  </body>
</html>
